﻿using System.Globalization;
using System.Windows.Data;

namespace ImageGenerator.Helpers
{
    public class String2VisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var key = (string)value;
            if (!string.IsNullOrWhiteSpace(key) )
                return Visibility.Visible;
            else
                return Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
